package cn.gson.crm.model.entity;


import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import lombok.Data;

/**
 * 学员历程
 * @author GHOST
 *
 */
@Entity
@Table(name="tb_wh_student_journey")
@Data
public class WhStudentJourney {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="tb_student_journey_id")
	private Long id;
	
	/**
	 * 记录时间
	 */
	@Column(name="recording_time")
	private String recordingTime;
	
	/**
	 * 学员外键
	 */
	@ManyToOne()
	@JoinColumn(name="student_id")
	private Student student;
	
	
	/**
	 * 历程图片
	 */
	@OneToOne
	@JoinColumn(name="image_id")
	private Images processImage;

	
	/**
	 * 历程内容
	 */
	private String content;
	
	/**
	 * 历程标题
	 */
	private String title;
	
	/**
	 * 学员历程中间表
	 */
	@ManyToMany
	@JoinTable(
			name="tb_wh_student_journey_zj",
			joinColumns= {
					@JoinColumn(name="student_id")
			},
			inverseJoinColumns= {
					@JoinColumn(name="journey_id")
			}
			)
	private List<Student> studentZJ;
}
